<extend name="Public/layout"/>
<block name="head">
<link rel="stylesheet" href="__PUBLIC__css/my-investor.css">
<script src="__PUBLIC__assets/better-scroll/bscroll.min.js"></script>
<style type="text/css">
.footer{
    display: none;
}
</style>
</block>
<block name="main">
    <div class="switches">
        <ul class="switches-wrapper">
            <li class="active" onclick="switchButton(this)"><span>已投资</span></li>
            <li onclick="switchButton(this)"><span>未投资</span></li>
        </ul>
    </div>
    <!--已投资列表-->
    <div class="list-content" id="invest-list">
        <div>
            <div class="list-header">
                <div class="left">
                    <span>手机号码/姓名</span>
                </div>
                <div class="right">
                    <span>注册平台</span>
                </div>
            </div>
            <ul class="list-wrapper">
                <foreach name="u_list" item='v'>
                <li class="list-item">
                    <a href="/Home/Person/investor_detail/val/1/data/<?php echo base64_encode(serialize(array('tel'=>$v['user_info']['user_phone'],'reg_time'=>$v['user_info_detail']['time_add'],'tz_plat'=>urlencode($v['platform_name']),'add_time'=>$v['add_time'],'invest_num'=>$v['invest_num'],'user_st'=>$v['user_st'],'push_st'=>$v['push_st']))); ?>">
                        <div class="left">
                            <p>{:hidtel($v['user_info']['user_phone'])}</p>
                            <span>{$v.user_info.nickname}</span>
                        </div>
                        <div class="right">
                            <div class="text-wrapper">
                                <p>{$v.platform_name}</p>
                                <span>查看详情</span>
                            </div>
                            <div class="arrow-wrapper">
                                <span class="arrow-right"></span>
                            </div>
                        </div>
                    </a>
                </li>
                </foreach>
            </ul>
        </div>
    </div>
    <!--未投资列表-->
    <div class="list-content" id="uninvest-list">
        <div>
            <div class="list-header">
                <div class="left">
                    <span>手机号码/姓名</span>
                </div>
                <div class="right">
                    <span>注册來源</span>
                </div>
            </div>
            <ul class="list-wrapper">
               <foreach name="un_obj" item="v">
                <li class="list-item">
                    <a href="/Home/Person/investor_detail/val/2/data/<?php echo base64_encode(serialize(array('tel'=>$v['user_phone'],'reg_time'=>$v['user_info_detail']['time_add'],'reg_plat'=>urlencode($v['platform_name'])))); ?>">
                        <div class="left">
                            <p>{:hidtel($v['user_phone'])}</p> 
                            <span>{$v.nickname}</span>
                        </div>
                        <div class="right">
                            <div class="text-wrapper">
                                <p>{$v.platform_name}营销着陆页</p>
                                <span>查看详情</span>
                            </div>
                            <div class="arrow-wrapper">
                                <span class="arrow-right"></span>
                            </div>
                        </div>
                    </a>
                </li>
                </foreach>
            </ul>
        </div>
    </div>
</block>
<block name="js">
<script>
    var wrapper1 = document.querySelector("#invest-list")
    var wrapper2 = document.querySelector("#uninvest-list")
    var scroll1 = new BScroll(wrapper1, {
        probeType: 1,
        click: true,
    })
    var scroll2 = new BScroll(wrapper2, {
        probeType: 1,
        click: true,
    })
    function switchButton(obj) {
        $(obj).addClass('active').siblings().removeClass('active')
        if ($(obj).children('span').text() == '已投资') {
            $('#uninvest-list').css({"transform": "translateX(100%)"}, {"zIndex": 0})
            $('#invest-list').css({"transform": "translateX(0)"})
            scroll2.refresh();
        } else {
            $('#uninvest-list').css({"transform": "translateX(0)"}, {"zIndex": 10})
            $('#invest-list').css({"transform": "translateX(-100%)"})
            scroll1.refresh();
        }
    }
</script>
</block>